﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KantoorDienst
{
    public partial class Main : Form
    {
        DBConnect db; 
        public Main()
        {
            InitializeComponent();
        }

        private void button18_Click(object sender, EventArgs e)
        {
            Verkoop v = new Verkoop();
            v.Show();
        }

        private void weaponEditBtn_Click(object sender, EventArgs e)
        {
            WeaponEdit w = new WeaponEdit();
            w.Show();
        }

        private void CaliberAdjBtn_Click(object sender, EventArgs e)
        {
            CaliberEdit c = new CaliberEdit();
            c.Show();
        }

        private void button9_Click(object sender, EventArgs e)
        {
            //saveFileDialog1.DefaultExt = ".zip";
            saveFileDialog1.FileName = "sqlBackup";
            saveFileDialog1.Filter = "SQL file|*.sql";
            DialogResult result = saveFileDialog1.ShowDialog();
            if (result == DialogResult.OK) // Test result.
            {
                db.Backup(saveFileDialog1.FileName);
            }
        }

        private void Main_Load(object sender, EventArgs e)
        {
            db = new DBConnect();
        }

        private void button19_Click(object sender, EventArgs e)
        {
            // Show the dialog and get result.
            openFileDialog1.FileName = "sqlBackup";
            openFileDialog1.Filter = "SQL file|*.sql";
            DialogResult result = openFileDialog1.ShowDialog();
            if (result == DialogResult.OK) // Test result.
            {
                db.Restore(openFileDialog1.FileName);
            }            
        }

        private void etcEditBtn_Click(object sender, EventArgs e)
        {
            minutionEdit me = new minutionEdit();
            me.Show();
        }
    }
}
